const http = require('../../api/index')
const http_info = require('../../api/campinfo')
const { baseURL } = require("../../utils/request")
Page({
data: {
  selectCampList:[],
  swiperList: [], // 存储轮播图的图片数组
  oss_url: baseURL,
  indicatorDots: true,  
  autoplay: true,  
  interval: 3000,  
  duration: 500,  
  current: 0  
},

// 生命周期函数部分
onLoad: function(par) {
  console.log(par);
  this.informationList(campId);

},

onShow: function() {
  this.bannerList(); // 再次调用获取轮播图数据的函数
  // this.informationList(campId);
},

// 方法部分
bannerList() {
  http.getBannerList().then(res => {
    if (res.code === 200) {
      this.setData({
        swiperList: res.rows
      });
    }
  });
},
informationList(campId) {
  http_info.getInformationcamp(campId).then(res => {
    if (res.code === 200) {
      this.setData({
        selectCampList: res.data
      });
    }
  });
},

swiperChange: function(e) {  
  this.setData({  
    current: e.detail.current  
  });  
}
})